package com.zh.web.openApi;

import com.zh.web.base.ApiResult;
import com.zh.web.config.DefaultFeignConfig;
import com.zh.web.domain.auth.dto.UserDto;
import com.zh.web.domain.auth.entity.User;
import com.zh.web.domain.auth.vo.UserVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * 用户管理接口对外提供 ,configuration = DefaultFeignConfig.class
 */
@FeignClient(name = "ls-service-user", path = "/user", contextId = "userClient", configuration = DefaultFeignConfig.class)
public interface UserClient {


    @GetMapping("/getUserInfoByToken")
    ApiResult<UserVo> getUserInfoByToken();

    @PostMapping("/getInfo")
    ApiResult<UserVo> getUserInfo(@RequestBody UserDto userDto);

    @PostMapping("/getUser")
    ApiResult<User> getUser(@RequestBody UserDto userDto);

    @GetMapping("/getUserCount")
    ApiResult<Integer> getUserCount();

    @PostMapping
    ApiResult<Long> addUser(@RequestBody User user);

    @GetMapping("/system/clearAllExpiredData")
    ApiResult<String> clearAllExpiredData();

    @PostMapping("/list")
    ApiResult<List<UserVo>> listUser(@RequestBody Collection<Long> userIds);
}
